package recharge

import (
	"gitee.com/liuxuezhan/ar-platform/assets-rpc/internal/dao/schema"
)

const TableNameRechargeChannel = "recharge_channel"

// RechargeChannel 充值通道
type RechargeChannel struct {
	schema.Model
	MappingCode  string  `gorm:"type:varchar(128);not null;comment:三方映射码"`
	Type         int32   `gorm:"type:tinyint;not null;comment:充值类型"`
	Name         string  `gorm:"type:varchar(64);not null;comment:名字"`
	Level        string  `gorm:"type:varchar(2048);comment:可见等级"`
	UserGroup    string  `gorm:"type:varchar(2048);comment:用户分组"`
	BonusRate    float64 `gorm:"type:decimal(20,4);not null;comment:赠送比率"`
	MinAmount    float64 `gorm:"type:decimal(20,4);not null;comment:最小金额"`
	MaxAmount    float64 `gorm:"type:decimal(20,4);not null;comment:最大金额"`
	AmountConfig string  `gorm:"type:varchar(255);not null;comment:金额配置"`
	MerchantID   string  `gorm:"type:varchar(32);not null;comment:商户号"`
	AppId        string  `gorm:"type:varchar(64);not null;comment:应用ID"`
	AppCode      string  `gorm:"type:varchar(100);not null;comment:应用CODE"`
	SecretKey    string  `gorm:"type:varchar(64);not null;comment:密钥"`
	URL          string  `gorm:"type:varchar(2048);not null;comment:支付地址"`
	ReturnUrl    string  `gorm:"type:varchar(2048);not null;comment:同步回调url"`
	NotifyUrl    string  `gorm:"type:varchar(2048);not null;comment:异步回调url"`
	PubKey       string  `gorm:"type:varchar(2048);not null;comment:公钥"`
	PrivateKey   string  `gorm:"type:varchar(2048);not null;comment:私钥"`
	StartTime    int64   `gorm:"type:bigint;not null;comment:开始时间"`
	EndTime      int64   `gorm:"type:bigint;not null;comment:结束时间"`
	Sort         int32   `gorm:"type:int;not null;comment:优先级"`
	Status       int32   `gorm:"type:int;not null;comment:状态 1开启2关闭"`
	IsTestable   int32   `gorm:"type:int;not null;comment:测试状态"`
	WhiteList    string  `gorm:"type:varchar(2048);not null;comment:回调白名单"`
	Remark       string  `gorm:"type:varchar(2048);not null;comment:备注"`
	Icon         string  `gorm:"type:varchar(2048);not null;comment:前端图标"`
	ChannelName  string  `gorm:"type:varchar(128);not null;comment:通道名字"`
	Coin         string  `gorm:"type:varchar(128);not null;comment:币种"`
}

func (*RechargeChannel) TableName() string {
	return TableNameRechargeChannel
}
